package com.szh.htmltopdf.strFilter;

import cn.hutool.core.io.resource.ResourceUtil;
import org.junit.jupiter.api.Test;

public class Main {
    public static void main(String[] args) throws Exception{
        SensitiveWordFilter.loadWordFromFile(ResourceUtil.getResource("SensitiveWordList.txt").getPath());
        StringBuilder stringBuilder = new StringBuilder();
        long t1,t2;
        for(int i=0;i<100;i++){
            stringBuilder.append("123TM,D123");
        }
        String s = stringBuilder.toString();
        String result = null;
        t1 = System.nanoTime();
        for(int i=0;i<10000;i++){
            result = SensitiveWordFilter.Filter(s);
        }
        t2 = System.nanoTime();
        System.out.println(result);
        System.out.println((t2 - t1) / 1000000 + "毫秒");
    }
    @Test
    public void test1(){
        
        
        
    }
}
